<!-- right-->
<div class="MemberMain">
<div style="margin-right:175px;">

<script>
var prediv = '';
function showMsg(obj,msgid,url) {
  var currdiv = $('view_msg_pro_'+msgid);
  if(!obj.parentNode.id) {
    if(typeof prediv == "object") {prediv.style.display='none'};
    currdiv.style.display = '';
    new Ajax(url,{method:'post',update:'view_msg_'+msgid,data:''}).request();
    obj.parentNode.id = 'span_'+msgid;
    if(prediv) {
      var link = $('span_'+prediv.id.substr(13)).getElementsByTagName('a')[0];
      link.className = 'viewmsgoff';
      toggleBg(link, false);
    }
    prediv = $('view_msg_pro_'+msgid);
    obj.className = 'viewmsg';
    toggleBg(obj, true);
  } else {
    if(currdiv.style.display == 'none') {
      currdiv.style.display = '';
      obj.className = 'viewmsg';
      toggleBg(obj, true);
      if(prediv) {
        prediv.style.display = 'none';
        var link = $('span_'+prediv.id.substr(13)).getElementsByTagName('a')[0];
        link.className = 'viewmsgoff';
        toggleBg(link, false);
      }
      prediv = currdiv;
    } else {
      currdiv.style.display = 'none';
      obj.className = 'viewmsgoff';
      toggleBg(obj, false);
      prediv = '';
    }
  }
}

function toggleBg(el, state){
  while(el.tagName != 'TR'){
    el = el.parentNode;
  }
  if(!state) $(el).removeClass('msgon');
  else $(el).addClass('msgon');
}

function checkAll(obj,box) {
  var tag = obj.getElementsByTagName('input');
  for(var i = 0;i < tag.length;i++){
    tag[i].checked = box.checked;
  }
}

</script>
  <div class="title"><{t}>已发送<{/t}></div>
  <form action="<{link ctl="member" act="delTrackMsg"}>" method="post">
<table width="100%" cellspacing="0" cellpadding="0" class="liststyle_option">
    <col class="span-0 textcenter"></col>
    <col class=" textleft"></col>

    <tr>
      <th class="textcenter"><input type="checkbox" onclick="checkAll(this.form,this)" name="chkall" id="chkall" title="全选"></th>
            <td><input type="submit" value="删除" name="pmsend /"></td>
            <td class="textright"><{t}>共有短消息:<{/t}><em id="pmtotalnum"><{$total_msg}></em></td>
    </tr>

    </table>
    <table width="100%" cellspacing="0" cellpadding="0" class="memberlist" summary="已发送">
             <col class="span-0 ColColorGraydark"></col>
    <col class="span-15 textleft"></col>
    <col class="span-3 ColColorOrange"></col>
    <col class="span-4"></col>
      <thead>
        <tr>
          <th >&nbsp;</th>
          <th ><{t}>标题<{/t}></th>
          <th ><{t}>发送到<{/t}></th>
          <th ><{t}>时间<{/t}></th>
        </tr>
      </thead>
      <tbody>
      <{if count($message)>0}>
        <{foreach item=msg from=$message}>
        <tr class="msg">
          <td class="selector"><input type="checkbox" value=<{$msg.msg_id}> name="deltrack[]"></td>
          <td class="textleft"><span><a href="<{link ctl='member' act='viewMsg' arg0=$msg.msg_id }>" onclick="showMsg(this,<{$msg.msg_id}>,'<{link ctl='member' act='viewMsg' arg0=$msg.msg_id }>');return false;" class="viewmsgoff"><{$msg.subject|escape:'html'}></a></span></td>
          <td><{if $msg.to_type == 1}><{t}>管理员<{/t}><{else}><{$msg.to_name}><{/if}></td>
          <td><{$msg.date_line|cdate:SDATE_STIME}></td>
        </tr>
      <tr id="view_msg_pro_<{$msg.msg_id}>" style="display:none; white-space:normal;">
        <td class="textleft memberviewinfo " colspan="6"><p id="view_msg_<{$msg.msg_id}>"><{$msg.message|escape:'html'}></p></td>
      </tr>
        <{/foreach}>
      <{else}>
      <tr>
      <td height="60" colspan="4" class="ColColorWhite">
        您尚未发送过站内短信息。
      </td>
      </tr>
      <{/if}>
      </tbody>
  </table>
    <table width="100%" cellspacing="0" cellpadding="0" class="liststyle_option">
    <col class="span-0 textcenter"></col>
    <col class=" textleft"></col>

    <tr>
      <th class="textcenter"><input type="checkbox" onclick="checkAll(this.form,this)" name="chkall" id="chkall" title="全选"></th>
            <td><input type="submit" value="删除" name="pmsend /"></td>
            <td class="textright"><{t}>共有短消息:<{/t}><em id="pmtotalnum"><{$total_msg}></em></td>
    </tr>

    </table>
  <{pager data=$pager}>

</form>

</div>
</div>
<!-- right-->
